//
//  CPAuthContentController.m
//  ChinaPoem
//
//  Created by 赵俊明 on 2019/3/7.
//  Copyright © 2019 赵俊明. All rights reserved.
//

#import "CPAuthContentController.h"
#import "CPContentTextView.h"
#import "UITextView+CPCapture.h"
@interface CPAuthContentController ()
@property(nonatomic, weak) CPContentTextView *poem;
@end

@implementation CPAuthContentController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.RImage = @"share";
    self.title = _model.cp_author;
    CPContentTextView *poem = [[CPContentTextView alloc] initWithFrame:CGRectMake(10, 74, kW-50, kH-74-20)];
    [poem cp_contentText:_model.cp_content fontSize:26];
    poem.textAlignment = NSTextAlignmentLeft;
    [poem cp_explanationText:_model.cp_content fontSize:17.0];
    [self.view addSubview:poem];
    self.poem = poem;
    [poem mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0, *)) {
            make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).offset(10);
            make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-10);;
        } else {
            make.top.mas_equalTo(self.view.mas_top).offset(10);
            make.bottom.mas_equalTo(self.view.mas_bottom).offset(-10);;
        }
        make.left.mas_equalTo(self.view).offset(10);
        make.right.mas_equalTo(self.view).offset(-10);
    }];
}


- (void)cp_rightBtn
{
    UIImage *image = [self.poem screenShotImage];
    [self cp_share:nil image:image handle:^(UIActivityType  _Nullable activityType, BOOL completed) {
        
    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
